#include <cstdio>
#include <cmath>

bool is_prime(int x);

int main(int argc, char const *argv[]){
    int k;
    while(scanf("%d", &k) != EOF){
        int count = 1, test_num = 2;
        while(count < k){
            test_num++;
            if (is_prime(test_num))
                count++;
    	}
    	printf("%d\n", test_num);
    }
    return 0;
}

bool is_prime(int x){
    if (x <= 1)
        return false;
    int bound = (int)sqrt(x) + 1; // time save: do not use sqrt() in loop
    for (int i = 2; i < bound; i++){
        if (x % i == 0){
            return false;
        }
    }
    return true;
}
